package com.ddxz.demo.distribute.controller;

import com.ddxz.demo.distribute.service.LockService;
import com.ddxz.tool.web.dto.DdxzResponse;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * class description
 *
 * @author 朱宗刚
 * @version 1.0.0
 * @date 2020/11/23
 */

@RestController
public class LockController {
    @RequestMapping(value = "/buy", method = RequestMethod.GET)
    public DdxzResponse buy(@RequestParam("pid") String productId) {
        return service.buy(productId);
    }

    private final LockService service;

    public LockController(LockService service) {
        this.service = service;
    }
}
